#include <stdlib.h>
#include <stdio.h>
#include <string.h>

/**
 * 对字符串的hash存储
 * */

long long get_hash(char *str){
    int a ;
    int c;
    long long hash = 0;
    printf("%s\n", str);
    a = 0;
    c = str[a];
    while(c){
        hash = hash * 257 + c;
        printf("%c\n", c);
        a++;
        c = str[a];
        printf("%lld\n", hash);
    }
}

int main(){
    char a[100];
    a[0] = 'a';
    a[1] = 'b';
    a[2] = 0;
    get_hash(a);
    return 0;
}
